Skip to content

Avoid fetching dependencies from TestPyPI - #2191

Merged
rgommers merged 1 commit into
pypa:mainfrom
rgommers:testpypi-usage-warning
Nov 17, 2026
Merged

rgommers merged 1 commit into
pypa:mainfrom
rgommers:testpypi-usage-warning

Conversation

@rgommers

@rgommers rgommers commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Use --no-deps and require a wheel to avoid downloading runtime or build dependencies from TestPyPI. Replace mixed-index installation advice with separate dependency installation from PyPI, and explain the risk of unintended or malicious packages.

The packaging tutorial already uses --no-deps and has similar guidance.

Closes gh-1500


📚 Documentation preview 📚: https://python-packaging-user-guide--2191.org.readthedocs.build/en/2191/

Use `--no-deps` and require a wheel to avoid downloading runtime or
build dependencies from TestPyPI. Replace mixed-index installation
advice with separate dependency installation from PyPI, and explain
the risk of unintended or malicious packages.

The packaging tutorial already uses `--no-deps` and has similar
guidance.

Closes pypagh-1500
@rgommers rgommers added type: bug A confirmed bug or unintended behavior component: guides labels Nov 13, 2026
@rgommers
rgommers added this pull request to the merge queue Nov 17, 2026
Merged via the queue into pypa:main with commit 70421ab Nov 17, 2026
10 of 11 checks passed
@rgommers
rgommers deleted the testpypi-usage-warning branch November 17, 2026 09:27
The ``--index-url`` flag selects TestPyPI instead of PyPI. The ``--no-deps``
flag prevents installing runtime dependencies, while ``--only-binary=:all:``
requires a wheel, avoiding installation of build dependencies. If your package
has dependencies, install them separately from PyPI before running these commands.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an existing doc about this to link to, or can an example of pip install --only-deps be added here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: guides type: bug A confirmed bug or unintended behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warn against using pip with test.pypi.org

3 participants